package com.ruoyi.source.service.impl;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.source.api.domain.SrcCity;
import com.ruoyi.source.api.domain.SrcProduct;
import com.ruoyi.source.mapper.SrcProductMapper;
import com.ruoyi.source.service.ISrcProductService;
import com.ruoyi.system.api.domain.SysDictData;
import org.springframework.stereotype.Service;

/**
 * 产品信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-23
 */
@Service
public class SrcProductServiceImpl extends ServiceImpl<SrcProductMapper,SrcProduct> implements ISrcProductService {



    /**
     * 查询产品信息列表
     * 
     * @param srcProduct 产品信息
     * @return 产品信息
     */
    @Override
    public List<SrcProduct> selectSrcProductList(SrcProduct srcProduct) {
        return baseMapper.selectSrcProductList(srcProduct);
    }

    /**
     * 新增产品信息
     * 
     * @param srcProduct 产品信息
     * @return 结果
     */
    @Override
    public int insertSrcProduct(SrcProduct srcProduct)
    {
        srcProduct.setCreateTime(new Date());
        srcProduct.setCreateBy(SecurityUtils.getUsername());
        srcProduct.setProductDate(new Date());
        int insert = baseMapper.insert(srcProduct);
        return insert;
    }




    @Override
    public List<SysDictData> typeList() {
        return baseMapper.typeList();
    }

    @Override
    public List<SrcCity> listcity() {
        return baseMapper.listcity();
    }
}
